sꞌ)   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 25

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 25
rs 8.8571
cc 1
nc 1
nop 0
1
describe('Mongo Model Generator', function() {
2
    it('Order Model exist', function () {
3
        expect(Test.document.Order).toBeDefined();
0 ignored issues
show
Bug introduced by
The variable Test seems to be never declared. If this is a global, consider adding a /** global: Test */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
4
    });
5
    it('OrderLineItem Model exist', function () {
6
        expect(Test.document.OrderLineItem).toBeDefined();
0 ignored issues
show
Bug introduced by
The variable Test seems to be never declared. If this is a global, consider adding a /** global: Test */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
7
    });
8
    it('Client Model exist', function () {
9
        expect(Test.document.Client).toBeDefined();
0 ignored issues
show
Bug introduced by
The variable Test seems to be never declared. If this is a global, consider adding a /** global: Test */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
10
    });
11
12
    describe('Model Associations', function() {
13
        it('order line item define in order', function() {
14
            var order = Ext.create('Test.document.Order');
0 ignored issues
show
Bug introduced by
The variable Ext seems to be never declared. If this is a global, consider adding a /** global: Ext */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
15
            expect(order.lineItems).toBeDefined();
16
        });
17
        it('client define in order', function() {
18
            var order = Ext.create('Test.document.Order');
0 ignored issues
show
Bug introduced by
The variable Ext seems to be never declared. If this is a global, consider adding a /** global: Ext */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
19
            expect(order.getClient).toBeDefined();
20
            expect(order.setClient).toBeDefined();
21
        });
22
        it('associate orders to client', function() {
23
            var order1 = Ext.create('Test.document.Order');
0 ignored issues
show
Bug introduced by
The variable Ext seems to be never declared. If this is a global, consider adding a /** global: Ext */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
24
            order1.set('name', 'Invoice 1');
25
            order1.set('float', 4.66);
26
            var order2 = Ext.create('Test.document.Order');
27
            order2.set('name', 'Invoice 2');
28
            order2.set('float', 10.01);
29
            var person = Ext.create('Test.document.Client', {id: 10});
30
            person.orders().add(order1, order2);
31
            expect(person.orders().count()).toEqual(2);
32
            person.orders().remove(order2);
33
            expect(person.orders().count()).toEqual(1);
34
            expect(order1.dirty).toBeTruthy();
35
        })
36
    });
37
});